module.exports = {
  // 要被 mockjs 拦截的请求集
  requests: [
    // 登录，返回token
    {
      type: 'get',
      url: '/login',
      tpl: {
        'result|1': /([a-z][A-z]\d){20}/
      }
    },
    {
      type: 'get',
      url: '/shop/info',
      tpl: {
        store_id: /\d{8}/,
        store_name: '美宜佳-@region()店',
        store_address: '@county(true)',
        live_shot: [
          'https://ymjuan.gitee.io/images/live_shot/dd.jpg',
          'https://ymjuan.gitee.io/images/live_shot/eee.jpg',
          'https://ymjuan.gitee.io/images/live_shot/qq.jpg'
        ],
        Business_license: [
          'https://ymjuan.gitee.io/images/Business_license/aaa.jpg',
          'https://ymjuan.gitee.io/images/Business_license/business1.jpg',
          'https://ymjuan.gitee.io/images/Business_license/business2.jpg'
        ]
      }
    },
    {
      type: 'get',
      url: '/shop/all',
      tpl: {
        data: {
          order: {
            collection: '@natural(1000, 10000)',
            refund: '@natural(100, 1000)',
            material_collection: '@natural(1000, 3000)',
            account_collection: '@natural(1000, 50000)',
            withdrawal: '@natural(1000, 50000)'
          },
          handle: {
            handle: '@natural(10, 10)',
            self_raising: '@natural(10, 20)',
            deliver_goods: '@natural(10, 10)',
            after_sale: '@natural(10, 20)'
          },
          goods: {
            count: '@natural(100, 1000)',
            new_goods: {
              xAxis: {
                type: 'category',
                boundaryGap: false,
                'data|10': ['@cword(2,3)']
              },
              yAxis: {
                type: 'value'
              },
              series: [
                {
                  'data|10': ['@natural(1,50)'],
                  type: 'line',
                  areaStyle: {}
                }
              ],
              title: {
                text: '新增商品图标'
              }
            },
            admin_goods: {
              xAxis: {
                type: 'category',
                boundaryGap: false,
                'data|20': ['@cword(2,3)']
              },
              yAxis: {
                type: 'value'
              },
              series: [
                {
                  'data|20': ['@natural(1,200)'],
                  type: 'line',
                  areaStyle: {}
                }
              ],
              title: {
                text: '商品管理图表'
              }
            }
          }
        }
      }
    }
  ]
}
